//
//  MGOperation.h
//  Mango
//
//  Created by 胡超 on 2021/3/1.
//  Copyright © 2021年 胡超., ltd. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class MGOperation;

typedef void(^MGOperationExecution)(__kindof MGOperation *op);

@interface MGOperation : NSOperation

+ (instancetype)operationWithExecution:(MGOperationExecution)execution;
+ (instancetype)operationInMainThreadWithExecution:(MGOperationExecution)execution;

- (instancetype)initWithExecution:(MGOperationExecution)execution inMainThread:(BOOL)inMainThread;

- (void)setFinished:(BOOL)finished;

@end

NS_ASSUME_NONNULL_END
